//
//  TernaryBootcamp.swift
//  SwiftUiExercise
//
//  Created by 徐鹏 on 2023/7/1.
//

import SwiftUI

struct TernaryBootcamp_25: View {
    
    @State var isStartingState: Bool = false
    
    var body: some View {
        VStack{
            Button("Button :\(isStartingState.description)") {
                isStartingState.toggle()
            }
            
            
            RoundedRectangle(cornerRadius: isStartingState ? 25 : 0)
                .fill(isStartingState ? Color.red : Color.blue)
                .frame(width: 200,height: 100)
           
            
            
            
            Spacer()
        }
    }
}

struct TernaryBootcamp_Previews: PreviewProvider {
    static var previews: some View {
        TernaryBootcamp_25()
    }
}
